package com.azier.kapacitor.script.node.qlnode;

import com.azier.kapacitor.script.arg.OriginalArg;
import com.azier.kapacitor.script.arg.SingleQuotesArg;
import com.azier.kapacitor.script.node.AbstractInfluxQLNode;
import com.azier.kapacitor.util.CollectionUtil;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Has no constructor signature.
**/

/**
没有构造函数签名。
*
 * @author 26354*/
public class BottomNode extends AbstractInfluxQLNode {
    private static final String name = "bottom";

    public BottomNode(Long num, String field, String ...fieldsAndTags) {
        super(new ArrayList<>(),name);
        this.args.add(new OriginalArg(num));
        this.args.add(new SingleQuotesArg(field));
        if(CollectionUtil.isNotEmpty(fieldsAndTags)){
            for (String fieldAndTag : fieldsAndTags){
                this.args.add(new SingleQuotesArg(fieldAndTag));
            }
        }
    }
}